<template>
  <div class="sy-container">
    <section class="gd1 xqgd">
      <a href="javascript:;" @click="back()"></a><h3>{{title.tt}}</h3>
    </section>
    <section class="xqct">
      <h3>{{title.xq.currentInfo.title}}</h3>
      <div class="ct">
        <div class="nav">
          <span class="house">来源：{{title.xq.currentInfo.keyword}}</span>
          <em>阅读量：{{title.xq.currentInfo.readnum}}</em>
          <i>时间：{{title.xq.currentInfo.createtime}}</i>
        </div>
        <div  v-html="title.msg2" class="dbct2">
        </div>
        <div class="xqbt">
          <a href="javascript:;" class="syp" :class="select3==0?'':'select'" @mouseover="select3=1,select4=0"  @click="qh(title.xq.upInfo.id,title.xq.upInfo.title)">上一篇：{{title.xq.upInfo.title==undefined?'没有了~~':title.xq.upInfo.title}}</a><br/>
          <a href="javascript:;" class="xyp" :class="select4==0?'':'select'" @mouseover="select3=0,select4=1" @click="qh(title.xq.downInfo.id,title.xq.downInfo.title)">下一篇：{{title.xq.downInfo.title==undefined?'没有了~~':title.xq.downInfo.title}}</a>
        </div>
      </div>
    </section>
  </div>
</template>

<script>
  import axios from 'axios';
  import $ from 'jquery';


  // import Logo from '~/components/Logo.vue'
  export default {
    components: {
      // Logo
    },
    data(){
      return{
        datas:null,
        gjdata:['工商服务管家','财税服务管家','知识产权管家','人事社保管家','资质审批管家'],
        gjdt:0,
        select:0,
        select3:0,
        select4:0,
        msg2:'nh',
        select2:6,
        size:'查看更多',
        nav:['工商服务','财税服务','知识产权','人事社保','资质计算器']
      }
    },
    async asyncData ({ params,query }) {
    let nh = await axios.get(`https://exam.zhonghaiqihang.com/PInterface/Info/infoDetailsData`,{
      params:{
        infoid:params.id
      }});
    let nh2;
    let nh3;
    if (query.name == 0){
      nh2 = '创业攻略'
      nh3 = 0;
    }else if(query.name == 1){
      nh2 = '解读政策'
      nh3 = 1;

    }else if(query.name == 2){
      nh2 = '企业百科'
      nh3 = 2;

    }
    let nhh = nh.data.currentInfo.content;
    let nhh1 = '' +nhh;
    function unescape(html){
      return html
        .replace(html ? /&(?!#?\w+;)/g : /&/g, '&amp;')
        .replace(/&lt;/g, "<")
        .replace(/&gt;/g, ">")
        .replace(/&quot;/g, "\"")
        .replace(/&#39;/g, "\'")
        .replace(/\/UEditOR/g, 'https://exam.zhonghaiqihang.com/UEditOR')
    }
    var nhh2= unescape(nhh1);
    let data  = {xq:nh.data,tt:nh2,msg2:nhh2,name:nh3};
    return { title: data}
  },
  head () {
    return {
      title: this.title.xq.currentInfo.title+'-企业邦',
      meta: [
        { hid: 'description', name: 'description', content: this.title.xq.currentInfo.summary },
        { hid: 'keywords', name: 'keywords', content:this.title.xq.currentInfo.keyword }
      ]
    }
  },
  mounted:function(){
    var _this = this;
    console.log(_this.title);
    console.log(_this.msg2);
    document.getElementById('head').style.display = 'none'

  },
  methods:{
    tzzym:function(e){
      console.log(e);
    },
    back:function(){
      this.$router.go(-1);
    },
    qh:function(e,e2) {
      var _this = this;
      if (e2 != undefined) {
        console.log(e)
        const new1 = this.$router.push('/Mobile/Details/'+e+'?name='+this.title.name);
        // window.open(new1.href, '_blank');
      }

    }

  }

  }
</script>

<style>

</style>
